package com.test.jni;

public class HelloJNI {

  static {
    System.load("D:\\CodeGoogle2\\GameGateway\\src\\MyDLL.dll");
  }

  public native void printHello();

  public native int add(int a, int b);

  public native int sub(int a, int b);

  public native int x(int a, int b);

  public native int c(int a, int b);
  
  public native int openCalc();

  public static void main(String[] args) {
    HelloJNI jni=new HelloJNI();
    //
    jni.printHello();
    //
    int a=jni.add(1, 2);
    assert (a == 3);
    System.out.println(a);
    //
    int b=jni.sub(2, 1);
    assert (b == 1);
    System.out.println(b);
    //
    int c=jni.x(1, 1);
    assert (c == 1);
    System.out.println(c);
    //
    int d=jni.c(10, 1);
    assert (d == 10);
    System.out.println(d);
    
    if(jni.openCalc()==1){
      System.out.println("open success");
    }
  }
}
